<template>
  <div>
    <el-upload
      ref='upload'
      :file-list='fileList'
      :on-success='handleSuccess'
      :on-remove='handleRemove'
    >
      <el-button slot='trigger' size='small' type='primary'>选择文件</el-button>
      <div slot='tip' class='el-upload__tip'>只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
  </div>
</template>

<script>
export default {
  data() {
    return {
      fileList: []
    }
  },
  methods: {
    handleSuccess(res, file, fileList) {
      console.log('handleSuccess:', res.file, fileList)
    },
    handleRemove(file, fileList) {
      console.log('handleRemove:', file, fileList)
    }
  }

}
</script>
<style scoped>

</style>
